From 3350b06d1122a39c24259598bede5d9717ba8c6e Mon Sep 17 00:00:00 2001
From: Dana Jansens <danakj@orodu.net>
Date: Sun, 10 Feb 2008 18:35:24 -0500
Subject: [PATCH 02/25] fix the "fixed popup position" options

- the text was wrong for the fixed y position popup (using left/right instead of top/bottom)
- the config wasn't being loaded correctly for them
---
 src/moveresize.c |   30 ++++++++++++++++++++++++------
 src/obconf.glade |    8 ++++----
 src/strings.c    |    4 ++--
 3 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/src/moveresize.c b/src/moveresize.c
index 3c9bade..47e91fc 100644
--- a/src/moveresize.c
+++ b/src/moveresize.c
@@ -43,6 +43,7 @@ void moveresize_setup_tab()
     GtkSizeGroup *group;
     gchar *s;
     gint pos, i;
+    gboolean opp;
 
     mapping = TRUE;
 
@@ -95,13 +96,30 @@ void moveresize_setup_tab()
     g_free(s);
     gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos);
 
+    w = get_widget("fixed_x_popup");
+    s = tree_get_string("resize/popupFixedPosition/x", "0");
+    opp = s[0] == '-';
+    if (s[0] == '-' || s[0] == '+') ++s;
+    if (!strcasecmp(s, "Center")) pos = EDGE_CENTER;
+    else if (opp) pos = EDGE_RIGHT;
+    else pos = EDGE_LEFT;
+    g_free(s);
+    gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos);
+
     w = get_widget("fixed_x_pos");
-    gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
-                              tree_get_int("resize/popupFixedPosition/x", 0));
+    gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), MAX(atoi(s), 0));
+
+    w = get_widget("fixed_y_popup");
+    s = tree_get_string("resize/popupFixedPosition/y", "0");
+    opp = s[0] == '-';
+    if (!strcasecmp(s, "Center")) pos = EDGE_CENTER;
+    else if (opp) pos = EDGE_RIGHT;
+    else pos = EDGE_LEFT;
+    g_free(s);
+    gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos);
 
     w = get_widget("fixed_y_pos");
-    gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
-                              tree_get_int("resize/popupFixedPosition/y", 0));
+    gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), MAX(atoi(s), 0));
 
     i = tree_get_int("mouse/screenEdgeWarpTime", 400);
 
@@ -301,7 +319,7 @@ void on_fixed_x_position_center_activate(GtkMenuItem *w, gpointer data)
     enable_stuff();
 }
 
-void on_fixed_y_position_left_activate(GtkMenuItem *w, gpointer data)
+void on_fixed_y_position_top_activate(GtkMenuItem *w, gpointer data)
 {
     if (mapping) return;
 
@@ -309,7 +327,7 @@ void on_fixed_y_position_left_activate(GtkMenuItem *w, gpointer data)
     enable_stuff();
 }
 
-void on_fixed_y_position_right_activate(GtkMenuItem *w, gpointer data)
+void on_fixed_y_position_bottom_activate(GtkMenuItem *w, gpointer data)
 {
     if (mapping) return;
 
diff --git a/src/obconf.glade b/src/obconf.glade
index e201785..896af35 100644
--- a/src/obconf.glade
+++ b/src/obconf.glade
@@ -2590,18 +2590,18 @@ Omnipresent (On all desktops)</property>
 						  <child>
 						    <widget class="GtkMenuItem" id="menuitem6">
 						      <property name="visible">True</property>
-						      <property name="label" translatable="yes">From left edge</property>
+						      <property name="label" translatable="yes">From top edge</property>
 						      <property name="use_underline">True</property>
-						      <signal name="activate" handler="on_fixed_y_position_left_activate" last_modification_time="Sat, 12 Jan 2008 17:54:45 GMT"/>
+						      <signal name="activate" handler="on_fixed_y_position_top_activate" last_modification_time="Sun, 10 Feb 2008 23:17:10 GMT"/>
 						    </widget>
 						  </child>
 
 						  <child>
 						    <widget class="GtkMenuItem" id="menuitem7">
 						      <property name="visible">True</property>
-						      <property name="label" translatable="yes">From right edge</property>
+						      <property name="label" translatable="yes">From bottom edge</property>
 						      <property name="use_underline">True</property>
-						      <signal name="activate" handler="on_fixed_y_position_right_activate" last_modification_time="Sat, 12 Jan 2008 17:54:45 GMT"/>
+						      <signal name="activate" handler="on_fixed_y_position_bottom_activate" last_modification_time="Sun, 10 Feb 2008 23:17:10 GMT"/>
 						    </widget>
 						  </child>
 						</widget>
diff --git a/src/strings.c b/src/strings.c
index 2447690..7e5c2c5 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -90,8 +90,8 @@ gchar *s = N_("From right edge");
 gchar *s = N_("px");
 gchar *s = N_("Fixed _y position:");
 gchar *s = N_("Centered");
-gchar *s = N_("From left edge");
-gchar *s = N_("From right edge");
+gchar *s = N_("From top edge");
+gchar *s = N_("From bottom edge");
 gchar *s = N_("px");
 gchar *s = N_("Move & Resize");
 gchar *s = N_("<span weight=\"bold\">Focusing Windows</span>");
-- 
1.7.3.4

From 03aadf423b4e4a19bc9444c36253f705eaf0386b Mon Sep 17 00:00:00 2001
From: Dana Jansens <danakj@orodu.net>
Date: Sun, 2 Mar 2008 00:17:47 -0500
Subject: [PATCH 06/25] add a nice decription of what the dock is

---
 src/obconf.glade |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/strings.c    |    3 ++
 2 files changed, 104 insertions(+), 0 deletions(-)

diff --git a/src/obconf.glade b/src/obconf.glade
index 896af35..81e926f 100644
--- a/src/obconf.glade
+++ b/src/obconf.glade
@@ -4885,6 +4885,107 @@ Omnipresent (On all desktops)</property>
 	      <property name="spacing">18</property>
 
 	      <child>
+		<widget class="GtkVBox" id="vbox84">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label234">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">&lt;span weight=&quot;bold&quot;&gt;Dock&lt;/span&gt;</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">True</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox118">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkLabel" id="label238">
+			  <property name="visible">True</property>
+			  <property name="label">    </property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label239">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">The dock is a special container for &quot;dockapps&quot;, or dock applications.  It is not visible on screen until a dockapp is run.  Dockapps can be used to show things like a clock, or to provide you with a system tray.</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">True</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
 		<widget class="GtkVBox" id="vbox27">
 		  <property name="visible">True</property>
 		  <property name="homogeneous">False</property>
diff --git a/src/strings.c b/src/strings.c
index 7e5c2c5..abf39b6 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -133,6 +133,9 @@ gchar *s = N_("px");
 gchar *s = N_("_Bottom");
 gchar *s = N_("px");
 gchar *s = N_("Margins");
+gchar *s = N_("<span weight=\"bold\">Dock</span>");
+gchar *s = N_("    ");
+gchar *s = N_("The dock is a special container for \"dockapps\", or dock applications.  It is not visible on screen until a dockapp is run.  Dockapps can be used to show things like a clock, or to provide you with a system tray.");
 gchar *s = N_("<span weight=\"bold\">Position</span>");
 gchar *s = N_("    ");
 gchar *s = N_("_Position:");
-- 
1.7.3.4

From 42b0ea6c275835bee09e83a2e83dfb934825aa8a Mon Sep 17 00:00:00 2001
From: Dana Jansens <danakj@orodu.net>
Date: Mon, 21 Dec 2009 13:01:55 -0500
Subject: [PATCH 16/25] Use the openbox 3.5 libs

---
 configure.ac         |    4 ++--
 src/desktops.c       |    2 +-
 src/main.c           |   19 ++++++++++++++++---
 src/main.h           |   11 ++++++-----
 src/mouse.c          |    6 +++---
 src/preview.c        |    8 +++++---
 src/preview.h        |    5 +++--
 src/preview_update.h |    2 +-
 src/theme.c          |    2 +-
 src/tree.c           |   32 ++++++++++++++++++++------------
 src/tree.h           |    4 +++-
 11 files changed, 61 insertions(+), 34 deletions(-)

diff --git a/configure.ac b/configure.ac
index bae2dfb..f9b0775 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ([2.54])
-AC_INIT([obconf], [2.0.3], [http://bugzilla.icculus.org])
+AC_INIT([obconf], [2.0.4], [http://bugzilla.icculus.org])
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([src/main.c])
 
@@ -20,7 +20,7 @@ ALL_LINGUAS=""
 AM_GNU_GETTEXT_VERSION(0.15)
 AM_GNU_GETTEXT([external])
 
-PKG_CHECK_MODULES(OPENBOX, [obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2])
+PKG_CHECK_MODULES(OPENBOX, [obrender-3.5 obt-3.5])
 AC_SUBST(OPENBOX_CFLAGS)
 AC_SUBST(OPENBOX_LIBS)
 
diff --git a/src/desktops.c b/src/desktops.c
index d7e9811..f1f0021 100644
--- a/src/desktops.c
+++ b/src/desktops.c
@@ -156,7 +156,7 @@ static void desktops_read_names()
         gchar *name;
 
         if (!xmlStrcmp(n->name, (const xmlChar*)"name")) {
-            name = parse_string(doc, n);
+            name = obt_parse_node_string(n);
 
             desktop_names = g_list_append(desktop_names, name);
 
diff --git a/src/main.c b/src/main.c
index 7083730..875b783 100644
--- a/src/main.c
+++ b/src/main.c
@@ -42,6 +42,8 @@ xmlDocPtr doc;
 xmlNodePtr root;
 RrInstance *rrinst;
 gchar *obc_config_file = NULL;
+ObtPaths *paths;
+ObtParseInst *parse_i;
 
 static gchar *obc_theme_install = NULL;
 static gchar *obc_theme_archive = NULL;
@@ -214,7 +216,8 @@ int main(int argc, char **argv)
         exit_with_error = TRUE;
     }
 
-    parse_paths_startup();
+    paths = obt_paths_new();
+    parse_i = obt_parse_instance_new();
     rrinst = RrInstanceNew(GDK_DISPLAY(), gdk_x11_get_default_screen());
 
     if (!obc_config_file) {
@@ -230,10 +233,19 @@ int main(int argc, char **argv)
     }
 
     xmlIndentTreeOutput = 1;
-    if (!parse_load_rc(obc_config_file, &doc, &root)) {
+    if (!obt_parse_load_config_file(parse_i,
+                                    "openbox",
+                                    (obc_config_file ?
+                                     obc_config_file : "rc.xml"),
+                                    "openbox_config"))
+    {
         obconf_error(_("Failed to load an rc.xml. You have probably failed to install Openbox properly."), TRUE);
         exit_with_error = TRUE;
     }
+    else {
+        doc = obt_parse_doc(parse_i);
+        root = obt_parse_root(parse_i);
+    }
 
     /* look for parsing errors */
     {
@@ -290,7 +302,8 @@ int main(int argc, char **argv)
     }
 
     RrInstanceFree(rrinst);
-    parse_paths_shutdown();
+    obt_parse_instance_unref(parse_i);
+    obt_paths_unref(paths);
 
     xmlFreeDoc(doc);
     return 0;
diff --git a/src/main.h b/src/main.h
index 7d6303c..2c06630 100644
--- a/src/main.h
+++ b/src/main.h
@@ -19,19 +19,20 @@
 #ifndef obconf__main_h
 #define obconf__main_h
 
-#include <openbox/render.h>
-#include <openbox/instance.h>
-#include <openbox/parse.h>
+#include <obrender/render.h>
+#include <obrender/instance.h>
+#include <obt/parse.h>
+#include <obt/paths.h>
 
 #include <gtk/gtk.h>
 #include <glade/glade-xml.h>
 
 extern GladeXML *glade;
-extern xmlDocPtr doc;
-extern xmlNodePtr root;
 extern RrInstance *rrinst;
 extern GtkWidget *mainwin;
 extern gchar *obc_config_file;
+extern ObtPaths *paths;
+extern ObtParseInst *parse_i;
 
 #define get_widget(s) glade_xml_get_widget(glade, s)
 
diff --git a/src/mouse.c b/src/mouse.c
index 68d9c55..831e2e5 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -19,7 +19,7 @@
 #include "main.h"
 #include "tree.h"
 #include "gettext.h"
-#include <openbox/parse.h>
+#include <obt/parse.h>
 
 static gboolean   mapping = FALSE;
 static xmlNodePtr saved_custom = NULL;
@@ -206,9 +206,9 @@ static gint read_doubleclick_action()
 
     while (n) {
         if (!xmlStrcmp(n->name, (const xmlChar*)"action")) {
-            if (parse_attr_contains("ToggleMaximizeFull", n, "name"))
+            if (obt_parse_attr_contains(n, "name", "ToggleMaximizeFull"))
                 ++max;
-            else if (parse_attr_contains("ToggleShade", n, "name"))
+            else if (obt_parse_attr_contains(n, "name", "ToggleShade"))
                 ++shade;
             else
                 ++other;
diff --git a/src/preview.c b/src/preview.c
index 7e463a8..a82cf15 100644
--- a/src/preview.c
+++ b/src/preview.c
@@ -23,7 +23,7 @@
 
 #include <string.h>
 
-#include <openbox/theme.h>
+#include <obrender/theme.h>
 
 #define PADDING 2 /* openbox does it :/ */
 
@@ -491,7 +491,8 @@ GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout,
                          RrFont *inactive_window_font,
                          RrFont *menu_title_font,
                          RrFont *menu_item_font,
-                         RrFont *osd_font)
+                         RrFont *osd_active_font,
+                         RrFont *osd_inactive_font)
 {
 
     GdkPixbuf *preview;
@@ -505,7 +506,8 @@ GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout,
 
     RrTheme *theme = RrThemeNew(rrinst, name, FALSE,
                                 active_window_font, inactive_window_font,
-                                menu_title_font, menu_item_font, osd_font);
+                                menu_title_font, menu_item_font,
+                                osd_active_font, osd_inactive_font);
     if (!theme)
         return NULL;
 
diff --git a/src/preview.h b/src/preview.h
index ff43766..772984b 100644
--- a/src/preview.h
+++ b/src/preview.h
@@ -21,7 +21,7 @@
 
 #include <glib.h>
 
-#include <openbox/font.h>
+#include <obrender/font.h>
 #include <gdk/gdkpixbuf.h>
 
 GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout,
@@ -29,6 +29,7 @@ GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout,
                          RrFont *inactive_window_font,
                          RrFont *menu_title_font,
                          RrFont *menu_item_font,
-                         RrFont *osd_font);
+                         RrFont *osd_active_font,
+                         RrFont *osd_inactive_font);
 
 #endif
diff --git a/src/preview_update.h b/src/preview_update.h
index 1fe9674..5163174 100644
--- a/src/preview_update.h
+++ b/src/preview_update.h
@@ -1,7 +1,7 @@
 #ifndef obconf__preview_update_h
 #define obconf__preview_update_h
 
-#include <openbox/render.h>
+#include <obrender/render.h>
 #include <gtk/gtk.h>
 
 void preview_update_all();
diff --git a/src/theme.c b/src/theme.c
index 093dc21..70206f9 100644
--- a/src/theme.c
+++ b/src/theme.c
@@ -193,7 +193,7 @@ void theme_load_all()
 
     {
         GSList *it;
-        for (it = parse_xdg_data_dir_paths(); it; it = g_slist_next(it)) {
+        for (it = obt_paths_data_dirs(paths); it; it = g_slist_next(it)) {
             p = g_build_filename(it->data, "themes", NULL);
             add_theme_dir(p);
             g_free(p);
diff --git a/src/tree.c b/src/tree.c
index 2c0f2dc..2b39840 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -19,7 +19,7 @@
 #include "tree.h"
 #include "main.h"
 
-#include <openbox/parse.h>
+#include <obt/parse.h>
 #include <gdk/gdkx.h>
 
 xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
@@ -28,7 +28,7 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
     gchar **nodes;
     gchar **it, **next;
 
-    n = root;
+    n = obt_parse_root(parse_i);
 
     nodes = g_strsplit(path, "/", 0);
     for (it = nodes; *it; it = next) {
@@ -39,19 +39,19 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
         next = it + 1;
 
         /* match attributes */
-        c = parse_find_node(attrs[0], n->children);
+        c = obt_parse_find_node(n->children, attrs[0]);
         while (c && !ok) {
             gint i;
 
             ok = TRUE;
             for (i = 1; attrs[i]; ++i) {
                 gchar **eq = g_strsplit(attrs[i], "=", 2);
-                if (eq[1] && !parse_attr_contains(eq[1], c, eq[0]))
+                if (eq[1] && !obt_parse_attr_contains(c, eq[0], eq[1]))
                     ok = FALSE;
                 g_strfreev(eq);
             }
             if (!ok)
-                c = parse_find_node(attrs[0], c->next);
+                c = obt_parse_find_node(c->next, attrs[0]);
         }
 
         if (!c) {
@@ -76,6 +76,15 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
     return n;
 }
 
+void tree_delete_node(const gchar *path)
+{
+    xmlNodePtr n;
+
+    n = tree_get_node(path, NULL);
+    xmlUnlinkNode(n);
+    xmlFreeNode(n);
+}
+
 void tree_apply()
 {
     gchar *p, *d;
@@ -84,15 +93,14 @@ void tree_apply()
     if (obc_config_file)
         p = g_strdup(obc_config_file);
     else
-        p = g_build_filename(parse_xdg_config_home_path(), "openbox",
+        p = g_build_filename(obt_paths_config_home(paths), "openbox",
                              "rc.xml", NULL);
 
     d = g_path_get_dirname(p);
-    parse_mkdir_path(d, 0700);
+    obt_paths_mkdir_path(d, 0700);
     g_free(d);
 
-    err = xmlSaveFormatFile(p, doc, 1) == -1;
-    if (err) {
+    if (!obt_parse_save_file(parse_i, p, TRUE)) {
         gchar *s;
         s = g_strdup_printf("An error occured while saving the "
                             "config file '%s'", p);
@@ -158,7 +166,7 @@ gchar* tree_get_string(const gchar *node, const gchar *def)
     xmlNodePtr n;
 
     n = tree_get_node(node, def);
-    return parse_string(doc, n);
+    return obt_parse_node_string(n);
 }
 
 gint tree_get_int(const gchar *node, gint def)
@@ -169,7 +177,7 @@ gint tree_get_int(const gchar *node, gint def)
     d = g_strdup_printf("%d", def);
     n = tree_get_node(node, d);
     g_free(d);
-    return parse_int(doc, n);
+    return obt_parse_node_int(n);
 }
 
 gboolean tree_get_bool(const gchar *node, gboolean def)
@@ -177,5 +185,5 @@ gboolean tree_get_bool(const gchar *node, gboolean def)
     xmlNodePtr n;
 
     n = tree_get_node(node, (def ? "yes" : "no"));
-    return parse_bool(doc, n);
+    return obt_parse_node_bool(n);
 }
diff --git a/src/tree.h b/src/tree.h
index 39c96b3..62a20c8 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -19,10 +19,12 @@
 #ifndef obconf__tree_h
 #define obconf__tree_h
 
-#include "openbox/parse.h"
+#include <obt/parse.h>
 
 xmlNodePtr tree_get_node(const gchar *path, const gchar *def);
 
+void tree_delete_node(const gchar *path);
+
 gchar* tree_get_string(const gchar *node, const gchar *def);
 gint tree_get_int(const gchar *node, gint def);
 gboolean tree_get_bool(const gchar *node, gboolean def);
-- 
1.7.3.4

From 0e1a17d18a4ddc008463a4e5290f5748d416723f Mon Sep 17 00:00:00 2001
From: Dana Jansens <danakj@orodu.net>
Date: Mon, 21 Dec 2009 13:02:09 -0500
Subject: [PATCH 17/25] Add the Inactive OSD font, and the primaryMonitor options

---
 src/appearance.c     |   45 +++++--
 src/main.c           |    3 +-
 src/obconf.glade     |  391 ++++++++++++++++++++++++++++++++++++++++++++++---
 src/preview_update.c |   23 +++-
 src/preview_update.h |    3 +-
 src/strings.c        |   12 ++-
 src/windows.c        |   58 ++++++++
 7 files changed, 490 insertions(+), 45 deletions(-)

diff --git a/src/appearance.c b/src/appearance.c
index 293e43f..f130311 100644
--- a/src/appearance.c
+++ b/src/appearance.c
@@ -23,7 +23,7 @@
 
 static gboolean mapping = FALSE;
 
-static RrFont *read_font(GtkFontButton *w, const gchar *place);
+static RrFont *read_font(GtkFontButton *w, const gchar *place, gboolean def);
 static RrFont *write_font(GtkFontButton *w, const gchar *place);
 
 void appearance_setup_tab()
@@ -49,24 +49,31 @@ void appearance_setup_tab()
     g_free(layout);
 
     w = get_widget("font_active");
-    f = read_font(GTK_FONT_BUTTON(w), "ActiveWindow");
+    f = read_font(GTK_FONT_BUTTON(w), "ActiveWindow", TRUE);
     preview_update_set_active_font(f);
 
     w = get_widget("font_inactive");
-    f = read_font(GTK_FONT_BUTTON(w), "InactiveWindow");
+    f = read_font(GTK_FONT_BUTTON(w), "InactiveWindow", TRUE);
     preview_update_set_inactive_font(f);
 
     w = get_widget("font_menu_header");
-    f = read_font(GTK_FONT_BUTTON(w), "MenuHeader");
+    f = read_font(GTK_FONT_BUTTON(w), "MenuHeader", TRUE);
     preview_update_set_menu_header_font(f);
 
     w = get_widget("font_menu_item");
-    f = read_font(GTK_FONT_BUTTON(w), "MenuItem");
+    f = read_font(GTK_FONT_BUTTON(w), "MenuItem", TRUE);
     preview_update_set_menu_item_font(f);
 
-    w = get_widget("font_display");
-    f = read_font(GTK_FONT_BUTTON(w), "OnScreenDisplay");
-    preview_update_set_osd_font(f);
+    w = get_widget("font_active_display");
+    if (!(f = read_font(GTK_FONT_BUTTON(w), "ActiveOnScreenDisplay", FALSE))) {
+        f = read_font(GTK_FONT_BUTTON(w), "OnScreenDisplay", TRUE);
+        tree_delete_node("theme/font:place=OnScreenDisplay");
+    }
+    preview_update_set_osd_active_font(f);
+
+    w = get_widget("font_inactive_display");
+    f = read_font(GTK_FONT_BUTTON(w), "InactiveOnScreenDisplay", TRUE);
+    preview_update_set_osd_inactive_font(f);
 
     mapping = FALSE;
 }
@@ -185,14 +192,23 @@ void on_font_menu_item_font_set(GtkFontButton *w, gpointer data)
     preview_update_set_menu_item_font(write_font(w, "MenuItem"));
 }
 
-void on_font_display_font_set(GtkFontButton *w, gpointer data)
+void on_font_active_display_font_set(GtkFontButton *w, gpointer data)
 {
     if (mapping) return;
 
-    preview_update_set_osd_font(write_font(w, "OnScreenDisplay"));
+    preview_update_set_osd_active_font(write_font(w, "ActiveOnScreenDisplay"));
 }
 
-static RrFont *read_font(GtkFontButton *w, const gchar *place)
+void on_font_inactive_display_font_set(GtkFontButton *w, gpointer data)
+{
+    if (mapping) return;
+
+    preview_update_set_osd_inactive_font
+        (write_font(w, "InactiveOnScreenDisplay"));
+}
+
+static RrFont *read_font(GtkFontButton *w, const gchar *place,
+                         gboolean use_default)
 {
     RrFont *font;
     gchar *fontstring, *node;
@@ -207,9 +223,14 @@ static RrFont *read_font(GtkFontButton *w, const gchar *place)
     mapping = TRUE;
 
     node = g_strdup_printf("theme/font:place=%s/name", place);
-    name = tree_get_string(node, "Sans");
+    name = tree_get_string(node, use_default ? "Sans" : NULL);
     g_free(node);
 
+    if (name[0] == '\0') {
+        g_free(name);
+        return NULL;
+    }
+
     node = g_strdup_printf("theme/font:place=%s/size", place);
     size = tree_get_string(node, "8");
     g_free(node);
diff --git a/src/main.c b/src/main.c
index 875b783..f72976e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -297,7 +297,8 @@ int main(int argc, char **argv)
         preview_update_set_inactive_font(NULL);
         preview_update_set_menu_header_font(NULL);
         preview_update_set_menu_item_font(NULL);
-        preview_update_set_osd_font(NULL);
+        preview_update_set_osd_active_font(NULL);
+        preview_update_set_osd_inactive_font(NULL);
         preview_update_set_title_layout(NULL);
     }
 
diff --git a/src/obconf.glade b/src/obconf.glade
index 81e926f..464acff 100644
--- a/src/obconf.glade
+++ b/src/obconf.glade
@@ -943,7 +943,7 @@ Omnipresent (On all desktops)</property>
 		      <child>
 			<widget class="GtkTable" id="table1">
 			  <property name="visible">True</property>
-			  <property name="n_rows">5</property>
+			  <property name="n_rows">6</property>
 			  <property name="n_columns">2</property>
 			  <property name="homogeneous">False</property>
 			  <property name="row_spacing">3</property>
@@ -1013,27 +1013,6 @@ Omnipresent (On all desktops)</property>
 			  </child>
 
 			  <child>
-			    <widget class="GtkFontButton" id="font_display">
-			      <property name="visible">True</property>
-			      <property name="can_focus">True</property>
-			      <property name="show_style">True</property>
-			      <property name="show_size">True</property>
-			      <property name="use_font">True</property>
-			      <property name="use_size">False</property>
-			      <property name="focus_on_click">True</property>
-			      <signal name="font_set" handler="on_font_display_font_set" last_modification_time="Fri, 25 May 2007 16:03:23 GMT"/>
-			    </widget>
-			    <packing>
-			      <property name="left_attach">1</property>
-			      <property name="right_attach">2</property>
-			      <property name="top_attach">4</property>
-			      <property name="bottom_attach">5</property>
-			      <property name="x_options">fill</property>
-			      <property name="y_options"></property>
-			    </packing>
-			  </child>
-
-			  <child>
 			    <widget class="GtkLabel" id="label94">
 			      <property name="visible">True</property>
 			      <property name="label" translatable="yes">_Active window title: </property>
@@ -1152,7 +1131,7 @@ Omnipresent (On all desktops)</property>
 			  <child>
 			    <widget class="GtkLabel" id="label98">
 			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">_On-screen display: </property>
+			      <property name="label" translatable="yes">Active _On-screen display: </property>
 			      <property name="use_underline">True</property>
 			      <property name="use_markup">False</property>
 			      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1162,7 +1141,6 @@ Omnipresent (On all desktops)</property>
 			      <property name="yalign">0.5</property>
 			      <property name="xpad">0</property>
 			      <property name="ypad">0</property>
-			      <property name="mnemonic_widget">font_display</property>
 			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
 			      <property name="width_chars">-1</property>
 			      <property name="single_line_mode">False</property>
@@ -1197,6 +1175,76 @@ Omnipresent (On all desktops)</property>
 			      <property name="y_options"></property>
 			    </packing>
 			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="label240">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Inactive O_n-screen display: </property>
+			      <property name="use_underline">True</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">1</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">0</property>
+			      <property name="right_attach">1</property>
+			      <property name="top_attach">5</property>
+			      <property name="bottom_attach">6</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkFontButton" id="font_active_display">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="show_style">True</property>
+			      <property name="show_size">True</property>
+			      <property name="use_font">True</property>
+			      <property name="use_size">False</property>
+			      <property name="focus_on_click">True</property>
+			      <signal name="font_set" handler="on_font_active_display_font_set" last_modification_time="Mon, 21 Dec 2009 16:08:46 GMT"/>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">4</property>
+			      <property name="bottom_attach">5</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkFontButton" id="font_inactive_display">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="show_style">True</property>
+			      <property name="show_size">True</property>
+			      <property name="use_font">True</property>
+			      <property name="use_size">False</property>
+			      <property name="focus_on_click">True</property>
+			      <signal name="font_set" handler="on_font_inactive_display_font_set" last_modification_time="Mon, 21 Dec 2009 16:08:52 GMT"/>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">5</property>
+			      <property name="bottom_attach">6</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
 			</widget>
 			<packing>
 			  <property name="padding">0</property>
@@ -1576,6 +1624,301 @@ Omnipresent (On all desktops)</property>
 		  <property name="fill">True</property>
 		</packing>
 	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox86">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label243">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">&lt;span weight=&quot;bold&quot;&gt;Primary Monitor&lt;/span&gt;</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">True</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox120">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkLabel" id="label244">
+			  <property name="visible">True</property>
+			  <property name="label">    </property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkVBox" id="vbox87">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">6</property>
+
+			  <child>
+			    <widget class="GtkHBox" id="hbox122">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">0</property>
+
+			      <child>
+				<widget class="GtkLabel" id="label246">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">The primary monitor is where Openbox will place dialogs, such as the one used for cycling windows.</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">True</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0</property>
+				  <property name="yalign">0</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">0</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkHBox" id="hbox121">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">6</property>
+
+			      <child>
+				<widget class="GtkLabel" id="label245">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Primary _monitor:</property>
+				  <property name="use_underline">True</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="mnemonic_widget">primary_monitor_popup</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkOptionMenu" id="primary_monitor_popup">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="history">1</property>
+
+				  <child>
+				    <widget class="GtkMenu" id="menu16">
+
+				      <child>
+					<widget class="GtkMenuItem" id="item1">
+					  <property name="visible">True</property>
+					  <property name="label" translatable="yes">Fixed Monitor</property>
+					  <property name="use_underline">True</property>
+					  <signal name="activate" handler="on_primary_monitor_fixed_activate" last_modification_time="Mon, 21 Dec 2009 18:23:48 GMT"/>
+					</widget>
+				      </child>
+
+				      <child>
+					<widget class="GtkMenuItem" id="active_monitor1">
+					  <property name="visible">True</property>
+					  <property name="label" translatable="yes">Active Monitor</property>
+					  <property name="use_underline">True</property>
+					  <signal name="activate" handler="on_primary_monitor_active_activate" last_modification_time="Mon, 21 Dec 2009 18:23:48 GMT"/>
+					</widget>
+				      </child>
+
+				      <child>
+					<widget class="GtkMenuItem" id="monitor_with_mouse_pointer1">
+					  <property name="visible">True</property>
+					  <property name="label" translatable="yes">Monitor With Mouse Pointer</property>
+					  <property name="use_underline">True</property>
+					  <signal name="activate" handler="on_primary_monitor_mouse_activate" last_modification_time="Mon, 21 Dec 2009 18:23:48 GMT"/>
+					</widget>
+				      </child>
+				    </widget>
+				  </child>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkHBox" id="hbox123">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">6</property>
+
+			      <child>
+				<widget class="GtkLabel" id="label249">
+				  <property name="visible">True</property>
+				  <property name="label">    </property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="label248">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">_Fixed monitor:</property>
+				  <property name="use_underline">True</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="mnemonic_widget">fixed_monitor</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkSpinButton" id="fixed_monitor">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="climb_rate">1</property>
+				  <property name="digits">0</property>
+				  <property name="numeric">False</property>
+				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+				  <property name="snap_to_ticks">False</property>
+				  <property name="wrap">False</property>
+				  <property name="adjustment">1 1 100 1 10 10</property>
+				  <signal name="value_changed" handler="on_fixed_monitor_value_changed" last_modification_time="Mon, 21 Dec 2009 18:32:45 GMT"/>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
 	    </widget>
 	    <packing>
 	      <property name="tab_expand">False</property>
diff --git a/src/preview_update.c b/src/preview_update.c
index a0e17c8..2f61fb7 100644
--- a/src/preview_update.c
+++ b/src/preview_update.c
@@ -10,18 +10,21 @@ static RrFont       *active_window_font   = NULL;
 static RrFont       *inactive_window_font = NULL;
 static RrFont       *menu_title_font      = NULL;
 static RrFont       *menu_item_font       = NULL;
-static RrFont       *osd_font             = NULL;
+static RrFont       *osd_active_font      = NULL;
+static RrFont       *osd_inactive_font    = NULL;
 
 static gboolean update_theme_preview_iterate(gpointer data);
 
 void preview_update_all()
 {
     if (!list_store) return;
+    if (!RR_CHECK_VERSION(3,5,0)) return;
 
     g_idle_remove_by_data(list_store);
 
     if (!(title_layout && active_window_font && inactive_window_font &&
-          menu_title_font && menu_item_font && osd_font))
+          menu_title_font && menu_item_font &&
+          osd_active_font && osd_inactive_font))
         return; /* not set up */
 
     restart_theme_preview_update = TRUE;
@@ -70,10 +73,17 @@ void preview_update_set_menu_item_font(RrFont *f)
     preview_update_all();
 }
 
-void preview_update_set_osd_font(RrFont *f)
+void preview_update_set_osd_active_font(RrFont *f)
 {
-    RrFontClose(osd_font);
-    osd_font = f;
+    RrFontClose(osd_active_font);
+    osd_active_font = f;
+    preview_update_all();
+}
+
+void preview_update_set_osd_inactive_font(RrFont *f)
+{
+    RrFontClose(osd_inactive_font);
+    osd_inactive_font = f;
     preview_update_all();
 }
 
@@ -123,7 +133,8 @@ static gboolean update_theme_preview_iterate(gpointer data)
     gtk_list_store_set(GTK_LIST_STORE(ls), &iter, 1,
                        preview_theme(name, title_layout, active_window_font,
                                      inactive_window_font, menu_title_font,
-                                     menu_item_font, osd_font),
+                                     menu_item_font, osd_active_font,
+                                     osd_inactive_font),
                        -1);
 
     return TRUE;
diff --git a/src/preview_update.h b/src/preview_update.h
index 5163174..596f092 100644
--- a/src/preview_update.h
+++ b/src/preview_update.h
@@ -11,7 +11,8 @@ void preview_update_set_active_font      (RrFont *f);
 void preview_update_set_inactive_font    (RrFont *f);
 void preview_update_set_menu_header_font (RrFont *f);
 void preview_update_set_menu_item_font   (RrFont *f);
-void preview_update_set_osd_font         (RrFont *f);
+void preview_update_set_osd_active_font  (RrFont *f);
+void preview_update_set_osd_inactive_font(RrFont *f);
 void preview_update_set_title_layout     (const gchar *layout);
 
 #endif
diff --git a/src/strings.c b/src/strings.c
index abf39b6..8e24f40 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -45,7 +45,8 @@ gchar *s = N_("_Active window title: ");
 gchar *s = N_("_Inactive window title: ");
 gchar *s = N_("Menu _header: ");
 gchar *s = N_("_Menu Item: ");
-gchar *s = N_("_On-screen display: ");
+gchar *s = N_("Active _On-screen display: ");
+gchar *s = N_("Inactive O_n-screen display: ");
 gchar *s = N_("Appearance");
 gchar *s = N_("<span weight=\"bold\">Focusing Windows</span>");
 gchar *s = N_("    ");
@@ -58,6 +59,15 @@ gchar *s = N_("Prefer to place new windows _on:");
 gchar *s = N_("All monitors");
 gchar *s = N_("The active monitor");
 gchar *s = N_("The monitor with the mouse");
+gchar *s = N_("<span weight=\"bold\">Primary Monitor</span>");
+gchar *s = N_("    ");
+gchar *s = N_("The primary monitor is where Openbox will place dialogs, such as the one used for cycling windows.");
+gchar *s = N_("Primary _monitor:");
+gchar *s = N_("Fixed Monitor");
+gchar *s = N_("Active Monitor");
+gchar *s = N_("Monitor With Mouse Pointer");
+gchar *s = N_("    ");
+gchar *s = N_("_Fixed monitor:");
 gchar *s = N_("Windows");
 gchar *s = N_("<span weight=\"bold\">Moving and Resizing Windows</span>");
 gchar *s = N_("    ");
diff --git a/src/windows.c b/src/windows.c
index ed5ed35..d2b4d96 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -23,6 +23,7 @@
 static gboolean mapping = FALSE;
 
 #define PLACE_ON_ALL    0
+#define PLACE_ON_FIXED 0
 #define PLACE_ON_ACTIVE 1
 #define PLACE_ON_MOUSE 2
 
@@ -59,6 +60,21 @@ void windows_setup_tab()
         gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_ALL);
     g_free(s);
 
+    w = get_widget("primary_monitor_popup");
+    s = tree_get_string("placement/primaryMonitor", "");
+    if (!g_ascii_strcasecmp(s, "Active"))
+        gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_ACTIVE);
+    else if (!g_ascii_strcasecmp(s, "Mouse"))
+        gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_MOUSE);
+    else {
+        gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_FIXED);
+
+        w = get_widget("fixed_monitor");
+        gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
+                                  tree_get_int("placement/primaryMonitor", 1));
+    }
+    g_free(s);
+
     enable_stuff();
 
     mapping = FALSE;
@@ -71,8 +87,50 @@ static void enable_stuff()
 
     w = get_widget("place_mouse");
     b = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
+
     w = get_widget("place_center");
     gtk_widget_set_sensitive(w, !b);
+
+    w = get_widget("primary_monitor_popup");
+    b = gtk_option_menu_get_history(GTK_OPTION_MENU(w)) == PLACE_ON_FIXED;
+    w = get_widget("fixed_monitor");
+    gtk_widget_set_sensitive(w, b);
+}
+
+void on_primary_monitor_active_activate(GtkMenuItem *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_string("placement/primaryMonitor", "Active");
+    enable_stuff();
+}
+
+void on_primary_monitor_mouse_activate(GtkMenuItem *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_string("placement/primaryMonitor", "Mouse");
+    enable_stuff();
+}
+
+void on_primary_monitor_fixed_activate(GtkMenuItem *w, gpointer data)
+{
+    GtkWidget *w2;
+
+    if (mapping) return;
+
+    w2 = get_widget("fixed_monitor");
+    tree_set_int("placement/primaryMonitor",
+                 gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w2)));
+    enable_stuff();
+}
+
+void on_fixed_monitor_value_changed(GtkSpinButton *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_int("placement/primaryMonitor",
+                 gtk_spin_button_get_value_as_int(w));
 }
 
 void on_focus_new_toggled(GtkToggleButton *w, gpointer data)
-- 
1.7.3.4

From 7562931bcf0857ce1522f81f9cb018a2f18ab817 Mon Sep 17 00:00:00 2001
From: Dana Jansens <danakj@orodu.net>
Date: Mon, 21 Dec 2009 14:06:45 -0500
Subject: [PATCH 18/25] use the new obt_xml stuff

---
 src/desktops.c |    2 +-
 src/main.c     |   20 ++++++++++----------
 src/main.h     |    4 ++--
 src/mouse.c    |    6 +++---
 src/tree.c     |   18 +++++++++---------
 src/tree.h     |    2 +-
 6 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/src/desktops.c b/src/desktops.c
index f1f0021..6f205c4 100644
--- a/src/desktops.c
+++ b/src/desktops.c
@@ -156,7 +156,7 @@ static void desktops_read_names()
         gchar *name;
 
         if (!xmlStrcmp(n->name, (const xmlChar*)"name")) {
-            name = obt_parse_node_string(n);
+            name = obt_xml_node_string(n);
 
             desktop_names = g_list_append(desktop_names, name);
 
diff --git a/src/main.c b/src/main.c
index f72976e..9035e8d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -43,7 +43,7 @@ xmlNodePtr root;
 RrInstance *rrinst;
 gchar *obc_config_file = NULL;
 ObtPaths *paths;
-ObtParseInst *parse_i;
+ObtXmlInst *parse_i;
 
 static gchar *obc_theme_install = NULL;
 static gchar *obc_theme_archive = NULL;
@@ -217,7 +217,7 @@ int main(int argc, char **argv)
     }
 
     paths = obt_paths_new();
-    parse_i = obt_parse_instance_new();
+    parse_i = obt_xml_instance_new();
     rrinst = RrInstanceNew(GDK_DISPLAY(), gdk_x11_get_default_screen());
 
     if (!obc_config_file) {
@@ -233,18 +233,18 @@ int main(int argc, char **argv)
     }
 
     xmlIndentTreeOutput = 1;
-    if (!obt_parse_load_config_file(parse_i,
-                                    "openbox",
-                                    (obc_config_file ?
-                                     obc_config_file : "rc.xml"),
-                                    "openbox_config"))
+    if (!obt_xml_load_config_file(parse_i,
+                                  "openbox",
+                                  (obc_config_file ?
+                                   obc_config_file : "rc.xml"),
+                                  "openbox_config"))
     {
         obconf_error(_("Failed to load an rc.xml. You have probably failed to install Openbox properly."), TRUE);
         exit_with_error = TRUE;
     }
     else {
-        doc = obt_parse_doc(parse_i);
-        root = obt_parse_root(parse_i);
+        doc = obt_xml_doc(parse_i);
+        root = obt_xml_root(parse_i);
     }
 
     /* look for parsing errors */
@@ -303,7 +303,7 @@ int main(int argc, char **argv)
     }
 
     RrInstanceFree(rrinst);
-    obt_parse_instance_unref(parse_i);
+    obt_xml_instance_unref(parse_i);
     obt_paths_unref(paths);
 
     xmlFreeDoc(doc);
diff --git a/src/main.h b/src/main.h
index 2c06630..4f3213b 100644
--- a/src/main.h
+++ b/src/main.h
@@ -21,7 +21,7 @@
 
 #include <obrender/render.h>
 #include <obrender/instance.h>
-#include <obt/parse.h>
+#include <obt/xml.h>
 #include <obt/paths.h>
 
 #include <gtk/gtk.h>
@@ -32,7 +32,7 @@ extern RrInstance *rrinst;
 extern GtkWidget *mainwin;
 extern gchar *obc_config_file;
 extern ObtPaths *paths;
-extern ObtParseInst *parse_i;
+extern ObtXmlInst *parse_i;
 
 #define get_widget(s) glade_xml_get_widget(glade, s)
 
diff --git a/src/mouse.c b/src/mouse.c
index 831e2e5..88f13d9 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -19,7 +19,7 @@
 #include "main.h"
 #include "tree.h"
 #include "gettext.h"
-#include <obt/parse.h>
+#include <obt/xml.h>
 
 static gboolean   mapping = FALSE;
 static xmlNodePtr saved_custom = NULL;
@@ -206,9 +206,9 @@ static gint read_doubleclick_action()
 
     while (n) {
         if (!xmlStrcmp(n->name, (const xmlChar*)"action")) {
-            if (obt_parse_attr_contains(n, "name", "ToggleMaximizeFull"))
+            if (obt_xml_attr_contains(n, "name", "ToggleMaximizeFull"))
                 ++max;
-            else if (obt_parse_attr_contains(n, "name", "ToggleShade"))
+            else if (obt_xml_attr_contains(n, "name", "ToggleShade"))
                 ++shade;
             else
                 ++other;
diff --git a/src/tree.c b/src/tree.c
index 2b39840..cbe9b90 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -19,7 +19,7 @@
 #include "tree.h"
 #include "main.h"
 
-#include <obt/parse.h>
+#include <obt/xml.h>
 #include <gdk/gdkx.h>
 
 xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
@@ -28,7 +28,7 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
     gchar **nodes;
     gchar **it, **next;
 
-    n = obt_parse_root(parse_i);
+    n = obt_xml_root(parse_i);
 
     nodes = g_strsplit(path, "/", 0);
     for (it = nodes; *it; it = next) {
@@ -39,19 +39,19 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
         next = it + 1;
 
         /* match attributes */
-        c = obt_parse_find_node(n->children, attrs[0]);
+        c = obt_xml_find_node(n->children, attrs[0]);
         while (c && !ok) {
             gint i;
 
             ok = TRUE;
             for (i = 1; attrs[i]; ++i) {
                 gchar **eq = g_strsplit(attrs[i], "=", 2);
-                if (eq[1] && !obt_parse_attr_contains(c, eq[0], eq[1]))
+                if (eq[1] && !obt_xml_attr_contains(c, eq[0], eq[1]))
                     ok = FALSE;
                 g_strfreev(eq);
             }
             if (!ok)
-                c = obt_parse_find_node(c->next, attrs[0]);
+                c = obt_xml_find_node(c->next, attrs[0]);
         }
 
         if (!c) {
@@ -100,7 +100,7 @@ void tree_apply()
     obt_paths_mkdir_path(d, 0700);
     g_free(d);
 
-    if (!obt_parse_save_file(parse_i, p, TRUE)) {
+    if (!obt_xml_save_file(parse_i, p, TRUE)) {
         gchar *s;
         s = g_strdup_printf("An error occured while saving the "
                             "config file '%s'", p);
@@ -166,7 +166,7 @@ gchar* tree_get_string(const gchar *node, const gchar *def)
     xmlNodePtr n;
 
     n = tree_get_node(node, def);
-    return obt_parse_node_string(n);
+    return obt_xml_node_string(n);
 }
 
 gint tree_get_int(const gchar *node, gint def)
@@ -177,7 +177,7 @@ gint tree_get_int(const gchar *node, gint def)
     d = g_strdup_printf("%d", def);
     n = tree_get_node(node, d);
     g_free(d);
-    return obt_parse_node_int(n);
+    return obt_xml_node_int(n);
 }
 
 gboolean tree_get_bool(const gchar *node, gboolean def)
@@ -185,5 +185,5 @@ gboolean tree_get_bool(const gchar *node, gboolean def)
     xmlNodePtr n;
 
     n = tree_get_node(node, (def ? "yes" : "no"));
-    return obt_parse_node_bool(n);
+    return obt_xml_node_bool(n);
 }
diff --git a/src/tree.h b/src/tree.h
index 62a20c8..4e9e170 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -19,7 +19,7 @@
 #ifndef obconf__tree_h
 #define obconf__tree_h
 
-#include <obt/parse.h>
+#include <obt/xml.h>
 
 xmlNodePtr tree_get_node(const gchar *path, const gchar *def);
 
-- 
1.7.3.4

From 6e27d7cd04de0a27381cd0770566f5e16b2a5801 Mon Sep 17 00:00:00 2001
From: Dana Jansens <danakj@orodu.net>
Date: Mon, 21 Dec 2009 14:09:05 -0500
Subject: [PATCH 19/25] add some configure stuff to .gitignore

---
 .gitignore |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 99fa800..a8279e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,8 +9,10 @@ config.guess
 config.log
 config.rpath
 config.status
+config.status.lineno
 config.sub
 configure
+configure.lineno
 depcomp
 install-sh
 missing
-- 
1.7.3.4

From e3545ed4e522e3495df95a8bf0c4e16f543b9e00 Mon Sep 17 00:00:00 2001
From: Dana Jansens <danakj@orodu.net>
Date: Mon, 21 Dec 2009 14:32:04 -0500
Subject: [PATCH 20/25] don't set the theme preview if a null is returned (trying to fix bug #3285)

---
 src/preview_update.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/preview_update.c b/src/preview_update.c
index 2f61fb7..638f364 100644
--- a/src/preview_update.c
+++ b/src/preview_update.c
@@ -1,4 +1,5 @@
 #include "preview_update.h"
+#include "preview.h"
 #include "main.h"
 
 static gboolean restart_theme_preview_update = TRUE;
@@ -97,6 +98,7 @@ void preview_update_set_title_layout(const gchar *layout)
 static gboolean update_theme_preview_iterate(gpointer data)
 {
     GtkListStore *ls = data;
+    GdkPixbuf *preview;
     static GtkTreeIter iter;
     gchar *name;
 
@@ -130,12 +132,12 @@ static gboolean update_theme_preview_iterate(gpointer data)
 
     gtk_tree_model_get(GTK_TREE_MODEL(ls), &iter, 0, &name, -1);
 
-    gtk_list_store_set(GTK_LIST_STORE(ls), &iter, 1,
-                       preview_theme(name, title_layout, active_window_font,
-                                     inactive_window_font, menu_title_font,
-                                     menu_item_font, osd_active_font,
-                                     osd_inactive_font),
-                       -1);
+    preview = preview_theme(name, title_layout, active_window_font,
+                            inactive_window_font, menu_title_font,
+                            menu_item_font, osd_active_font,
+                            osd_inactive_font);
+    if (preview)
+        gtk_list_store_set(GTK_LIST_STORE(ls), &iter, 1, preview, -1);
 
     return TRUE;
 }
-- 
1.7.3.4

From b0465895c15c544111f0dbbcbffab56b476a8749 Mon Sep 17 00:00:00 2001
From: Dana Jansens <danakj@orodu.net>
Date: Fri, 12 Feb 2010 15:18:02 -0500
Subject: [PATCH 21/25] don't use a non-zero page size for some spinners (Fix bug #4540)

---
 src/obconf.glade |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/obconf.glade b/src/obconf.glade
index 464acff..0e024f8 100644
--- a/src/obconf.glade
+++ b/src/obconf.glade
@@ -2086,7 +2086,7 @@ Omnipresent (On all desktops)</property>
 				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				  <property name="snap_to_ticks">False</property>
 				  <property name="wrap">False</property>
-				  <property name="adjustment">1 1 100 1 10 10</property>
+				  <property name="adjustment">1 1 100 1 10 0</property>
 				  <signal name="value_changed" handler="on_drag_threshold_value_changed" after="yes" last_modification_time="Thu, 31 May 2007 16:02:00 GMT"/>
 				</widget>
 				<packing>
@@ -2170,7 +2170,7 @@ Omnipresent (On all desktops)</property>
 				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				  <property name="snap_to_ticks">False</property>
 				  <property name="wrap">False</property>
-				  <property name="adjustment">20 0 100 1 10 10</property>
+				  <property name="adjustment">20 0 100 1 10 0</property>
 				  <signal name="value_changed" handler="on_resist_window_value_changed" after="yes" last_modification_time="Tue, 23 Sep 2003 22:22:53 GMT"/>
 				</widget>
 				<packing>
@@ -2254,7 +2254,7 @@ Omnipresent (On all desktops)</property>
 				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				  <property name="snap_to_ticks">False</property>
 				  <property name="wrap">False</property>
-				  <property name="adjustment">1 0 100 1 10 10</property>
+				  <property name="adjustment">1 0 100 1 10 0</property>
 				  <signal name="value_changed" handler="on_resist_edge_value_changed" after="yes" last_modification_time="Tue, 23 Sep 2003 22:23:04 GMT"/>
 				</widget>
 				<packing>
@@ -2389,7 +2389,7 @@ Omnipresent (On all desktops)</property>
 				      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				      <property name="snap_to_ticks">False</property>
 				      <property name="wrap">False</property>
-				      <property name="adjustment">0 100 10000 10 10 10</property>
+				      <property name="adjustment">0 100 10000 10 10 0</property>
 				      <signal name="value_changed" handler="on_warp_edge_time_value_changed" after="yes" last_modification_time="Sat, 04 Aug 2007 15:51:02 GMT"/>
 				    </widget>
 				    <packing>
@@ -2831,7 +2831,7 @@ Omnipresent (On all desktops)</property>
 						  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 						  <property name="snap_to_ticks">False</property>
 						  <property name="wrap">False</property>
-						  <property name="adjustment">1 0 1000 1 10 10</property>
+						  <property name="adjustment">1 0 1000 1 10 0</property>
 						  <signal name="value_changed" handler="on_fixed_x_pos_value_changed" after="yes" last_modification_time="Sat, 12 Jan 2008 18:21:45 GMT"/>
 						</widget>
 						<packing>
@@ -2973,7 +2973,7 @@ Omnipresent (On all desktops)</property>
 						  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 						  <property name="snap_to_ticks">False</property>
 						  <property name="wrap">False</property>
-						  <property name="adjustment">1 0 1000 1 10 10</property>
+						  <property name="adjustment">1 0 1000 1 10 0</property>
 						  <signal name="value_changed" handler="on_fixed_y_pos_value_changed" after="yes" last_modification_time="Sat, 12 Jan 2008 18:22:16 GMT"/>
 						</widget>
 						<packing>
@@ -3327,7 +3327,7 @@ Omnipresent (On all desktops)</property>
 					  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 					  <property name="snap_to_ticks">False</property>
 					  <property name="wrap">False</property>
-					  <property name="adjustment">0 0 10000 10 10 10</property>
+					  <property name="adjustment">0 0 10000 10 10 0</property>
 					  <signal name="value_changed" handler="on_focus_delay_value_changed" after="yes" last_modification_time="Sun, 14 Sep 2003 11:24:28 GMT"/>
 					</widget>
 					<packing>
@@ -3589,7 +3589,7 @@ Omnipresent (On all desktops)</property>
 				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				  <property name="snap_to_ticks">False</property>
 				  <property name="wrap">False</property>
-				  <property name="adjustment">0 0 10000 10 10 10</property>
+				  <property name="adjustment">0 0 10000 10 10 0</property>
 				  <signal name="value_changed" handler="on_doubleclick_time_value_changed" after="yes" last_modification_time="Thu, 31 May 2007 16:09:40 GMT"/>
 				</widget>
 				<packing>
@@ -3895,7 +3895,7 @@ Omnipresent (On all desktops)</property>
 				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				  <property name="snap_to_ticks">False</property>
 				  <property name="wrap">False</property>
-				  <property name="adjustment">0 1 10000 10 10 10</property>
+				  <property name="adjustment">0 1 10000 10 10 0</property>
 				  <signal name="value_changed" handler="on_desktop_popup_time_value_changed" after="yes" last_modification_time="Sat, 04 Aug 2007 16:03:27 GMT"/>
 				</widget>
 				<packing>
@@ -3986,7 +3986,7 @@ Omnipresent (On all desktops)</property>
 			      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 			      <property name="snap_to_ticks">False</property>
 			      <property name="wrap">False</property>
-			      <property name="adjustment">1 1 100 1 10 10</property>
+			      <property name="adjustment">1 1 100 1 10 0</property>
 			      <signal name="value_changed" handler="on_desktop_num_value_changed" after="yes" last_modification_time="Mon, 15 Sep 2003 01:16:20 GMT"/>
 			    </widget>
 			    <packing>
@@ -4331,7 +4331,7 @@ Omnipresent (On all desktops)</property>
 					  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 					  <property name="snap_to_ticks">False</property>
 					  <property name="wrap">False</property>
-					  <property name="adjustment">20 0 100 1 10 10</property>
+					  <property name="adjustment">20 0 100 1 10 0</property>
 					  <signal name="value_changed" handler="on_margins_top_value_changed" after="yes" last_modification_time="Thu, 19 Jul 2007 23:50:09 GMT"/>
 					</widget>
 					<packing>
@@ -4573,7 +4573,7 @@ Omnipresent (On all desktops)</property>
 				      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				      <property name="snap_to_ticks">False</property>
 				      <property name="wrap">False</property>
-				      <property name="adjustment">20 0 100 1 10 10</property>
+				      <property name="adjustment">20 0 100 1 10 0</property>
 				      <signal name="value_changed" handler="on_margins_left_value_changed" after="yes" last_modification_time="Thu, 19 Jul 2007 23:50:31 GMT"/>
 				    </widget>
 				    <packing>
@@ -4786,7 +4786,7 @@ Omnipresent (On all desktops)</property>
 				      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				      <property name="snap_to_ticks">False</property>
 				      <property name="wrap">False</property>
-				      <property name="adjustment">20 0 100 1 10 10</property>
+				      <property name="adjustment">20 0 100 1 10 0</property>
 				      <signal name="value_changed" handler="on_margins_right_value_changed" after="yes" last_modification_time="Thu, 19 Jul 2007 23:50:41 GMT"/>
 				    </widget>
 				    <packing>
@@ -5021,7 +5021,7 @@ Omnipresent (On all desktops)</property>
 				      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				      <property name="snap_to_ticks">False</property>
 				      <property name="wrap">False</property>
-				      <property name="adjustment">20 0 100 1 10 10</property>
+				      <property name="adjustment">20 0 100 1 10 0</property>
 				      <signal name="value_changed" handler="on_margins_bottom_value_changed" after="yes" last_modification_time="Thu, 19 Jul 2007 23:50:59 GMT"/>
 				    </widget>
 				    <packing>
@@ -5607,7 +5607,7 @@ Omnipresent (On all desktops)</property>
 				      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				      <property name="snap_to_ticks">False</property>
 				      <property name="wrap">False</property>
-				      <property name="adjustment">1 0 10000 1 10 10</property>
+				      <property name="adjustment">1 0 10000 1 10 0</property>
 				      <signal name="value_changed" handler="on_dock_float_x_value_changed" after="yes" last_modification_time="Sun, 14 Sep 2003 11:07:38 GMT"/>
 				    </widget>
 				    <packing>
@@ -5652,7 +5652,7 @@ Omnipresent (On all desktops)</property>
 				      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				      <property name="snap_to_ticks">False</property>
 				      <property name="wrap">False</property>
-				      <property name="adjustment">1 0 10000 1 10 10</property>
+				      <property name="adjustment">1 0 10000 1 10 0</property>
 				      <signal name="value_changed" handler="on_dock_float_y_value_changed" after="yes" last_modification_time="Sun, 14 Sep 2003 11:08:09 GMT"/>
 				    </widget>
 				    <packing>
@@ -6142,7 +6142,7 @@ Omnipresent (On all desktops)</property>
 				      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				      <property name="snap_to_ticks">False</property>
 				      <property name="wrap">False</property>
-				      <property name="adjustment">300 0 10000 10 10 10</property>
+				      <property name="adjustment">300 0 10000 10 10 0</property>
 				      <signal name="value_changed" handler="on_dock_hide_delay_value_changed" after="yes" last_modification_time="Sun, 14 Sep 2003 11:08:49 GMT"/>
 				    </widget>
 				    <packing>
@@ -6264,7 +6264,7 @@ Omnipresent (On all desktops)</property>
 				      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 				      <property name="snap_to_ticks">False</property>
 				      <property name="wrap">False</property>
-				      <property name="adjustment">300 0 10000 10 10 10</property>
+				      <property name="adjustment">300 0 10000 10 10 0</property>
 				      <signal name="value_changed" handler="on_dock_show_delay_value_changed" after="yes" last_modification_time="Thu, 31 May 2007 15:17:16 GMT"/>
 				    </widget>
 				    <packing>
-- 
1.7.3.4

From 500163e2c74cbbded0361574fd14d0a1168c1119 Mon Sep 17 00:00:00 2001
From: Dana Jansens <danakj@orodu.net>
Date: Tue, 9 Mar 2010 10:51:02 -0500
Subject: [PATCH 23/25] remove unneeded strdup

---
 src/archive.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/src/archive.c b/src/archive.c
index b3404d7..1264627 100644
--- a/src/archive.c
+++ b/src/archive.c
@@ -164,15 +164,12 @@ static gboolean change_dir(const gchar *dir)
 
 static gchar* install_theme_to(const gchar *file, const gchar *to)
 {
-    gchar *glob;
     gchar **argv;
     gchar *errtxt = NULL, *outtxt = NULL;
     gint exitcode;
     GError *e = NULL;
     gchar *name = NULL;
 
-    glob = g_strdup_printf("*/openbox-3/", name);
-
     argv = g_new(gchar*, 11);
     argv[0] = g_strdup("tar");
     argv[1] = g_strdup("-x");
@@ -183,7 +180,7 @@ static gchar* install_theme_to(const gchar *file, const gchar *to)
     argv[6] = g_strdup(file);
     argv[7] = g_strdup("-C");
     argv[8] = g_strdup(to);
-    argv[9] = g_strdup(glob);
+    argv[9] = g_strdup("*/openbox-3/");
     argv[10] = NULL;
     if (!g_spawn_sync(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
                       &outtxt, &errtxt, &exitcode, &e))
@@ -222,6 +219,5 @@ static gchar* install_theme_to(const gchar *file, const gchar *to)
 
     g_free(outtxt);
     g_free(errtxt);
-    g_free(glob);
     return name;
 }
-- 
1.7.3.4

From 9cffa6a9ddfc4074f3de8d0302404d70c2818d8f Mon Sep 17 00:00:00 2001
From: Markos Chandras <hwoarang@gentoo.org>
Date: Fri, 5 Aug 2011 16:24:57 +0100
Subject: [PATCH 24/25] Use new RrButton structure

---
 src/preview.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/preview.c b/src/preview.c
index a82cf15..320e7ac 100644
--- a/src/preview.c
+++ b/src/preview.c
@@ -327,28 +327,28 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout,
             switch (*layout) {
             case 'D':
                 a = focus ?
-                    theme->a_focused_unpressed_desk :
-                    theme->a_unfocused_unpressed_desk;
+                    theme->btn_desk->a_focused_unpressed :
+                    theme->btn_desk->a_unfocused_unpressed;
                 break;
             case 'S':
                 a = focus ?
-                    theme->a_focused_unpressed_shade :
-                    theme->a_unfocused_unpressed_shade;
+                    theme->btn_shade->a_focused_unpressed :
+                    theme->btn_shade->a_unfocused_unpressed;
                 break;
             case 'I':
                 a = focus ?
-                    theme->a_focused_unpressed_iconify :
-                    theme->a_unfocused_unpressed_iconify;
+                    theme->btn_iconify->a_focused_unpressed :
+                    theme->btn_iconify->a_unfocused_unpressed;
                 break;
             case 'M':
                 a = focus ?
-                    theme->a_focused_unpressed_max :
-                    theme->a_unfocused_unpressed_max;
+                    theme->btn_max->a_focused_unpressed :
+                    theme->btn_max->a_unfocused_unpressed;
                 break;
             case 'C':
                 a = focus ?
-                    theme->a_focused_unpressed_close :
-                    theme->a_unfocused_unpressed_close;
+                    theme->btn_close->a_focused_unpressed :
+                    theme->btn_close->a_unfocused_unpressed;
                 break;
             default:
                 continue;
-- 
1.7.3.4

From cc7a18807663313ef111d86a75844ded0416a889 Mon Sep 17 00:00:00 2001
From: Dana Jansens <danakj@orodu.net>
Date: Fri, 5 Aug 2011 12:05:10 -0400
Subject: [PATCH 25/25] Load the rc.xml config file given on --config-file the same as Openbox (use the whole path given).

---
 src/main.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/main.c b/src/main.c
index 9035e8d..a576253 100644
--- a/src/main.c
+++ b/src/main.c
@@ -233,11 +233,10 @@ int main(int argc, char **argv)
     }
 
     xmlIndentTreeOutput = 1;
-    if (!obt_xml_load_config_file(parse_i,
-                                  "openbox",
-                                  (obc_config_file ?
-                                   obc_config_file : "rc.xml"),
-                                  "openbox_config"))
+    if (!((obc_config_file &&
+           obt_xml_load_file(parse_i, obc_config_file, "openbox_config")) ||
+          obt_xml_load_config_file(parse_i, "openbox", "rc.xml",
+                                   "openbox_config")))
     {
         obconf_error(_("Failed to load an rc.xml. You have probably failed to install Openbox properly."), TRUE);
         exit_with_error = TRUE;
-- 
1.7.3.4

--- obconf-2.0.3.org/configure
+++ obconf-2.0.3/configure
@@ -5887,12 +5887,12 @@
         pkg_cv_OPENBOX_CFLAGS="$OPENBOX_CFLAGS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2\"") >&5
-  ($PKG_CONFIG --exists --print-errors "obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2") 2>&5
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"obrender-3.5 obt-3.5\"") >&5
+  ($PKG_CONFIG --exists --print-errors "obrender-3.5 obt-3.5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_OPENBOX_CFLAGS=`$PKG_CONFIG --cflags "obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2" 2>/dev/null`
+  pkg_cv_OPENBOX_CFLAGS=`$PKG_CONFIG --cflags "obrender-3.5 obt-3.5" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -5905,12 +5905,12 @@
         pkg_cv_OPENBOX_LIBS="$OPENBOX_LIBS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2\"") >&5
-  ($PKG_CONFIG --exists --print-errors "obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2") 2>&5
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"obrender-3.5 obt-3.5\"") >&5
+  ($PKG_CONFIG --exists --print-errors "obrender-3.5 obt-3.5 >= 3.4.2") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_OPENBOX_LIBS=`$PKG_CONFIG --libs "obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2" 2>/dev/null`
+  pkg_cv_OPENBOX_LIBS=`$PKG_CONFIG --libs "obrender-3.5 obt-3.5" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -5929,14 +5929,14 @@
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        OPENBOX_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2"`
+	        OPENBOX_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "obrender-3.5 obt-3.5"`
         else
-	        OPENBOX_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2"`
+	        OPENBOX_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "obrender-3.5 obt-3.5"`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$OPENBOX_PKG_ERRORS" >&5
 
-	{ { echo "$as_me:$LINENO: error: Package requirements (obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2) were not met:
+	{ { echo "$as_me:$LINENO: error: Package requirements (obrender-3.5 obt-3.5) were not met:
 
 $OPENBOX_PKG_ERRORS
 
@@ -5947,7 +5947,7 @@
 and OPENBOX_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 " >&5
-echo "$as_me: error: Package requirements (obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2) were not met:
+echo "$as_me: error: Package requirements (obrender-3.5 obt-3.5) were not met:
 
 $OPENBOX_PKG_ERRORS
 
